class Solution:
    def removeElement(self, nums, val: int) -> int:
        while val in nums: nums.remove(val)
        return len(nums)

if __name__ == '__main__':
    s = Solution()

    # L = [3, 2, 2, 3]
    # s.removeElement(L, 3)

    # L = [0, 1, 2, 2, 3, 0, 4, 2]
    # s.removeElement(L, 2)

    L = [1, 1, 1, 1]
    s.removeElement(L, 1)